//
//  MqInfoAuthTableViewCell.m
//  Meiqi
//
//  Created by 王郑 on 16/1/18.
//  Copyright © 2016年 KFC. All rights reserved.
//

#import "MqInfoAuthTableViewCell.h"

@implementation MqInfoAuthTableViewCell


- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        
        
        _headImageV = [[UIImageView alloc] initWithFrame:CGRectMake(20*kWidthBase, 20*kHeightBase, 100*kWidthBase, 100*kHeightBase)];
        _headImageV.layer.cornerRadius = 50*kHeightBase;
        [self.contentView addSubview:_headImageV];
        
        _nameLabel = [[UILabel alloc] initWithFrame:CGRectMake(_headImageV.left, _headImageV.bottom + 5*kHeightBase, _headImageV.width, 20*kHeightBase)];
        _nameLabel.textAlignment = NSTextAlignmentCenter;
        //_nameLabel.backgroundColor = [UIColor redColor];
        _nameLabel.font = [UIFont systemFontOfSize:20];
        [self.contentView addSubview:_nameLabel];
        
        _positionLabel = [[UILabel alloc] initWithFrame:CGRectMake(_nameLabel.left, _nameLabel.bottom, _nameLabel.width , _nameLabel.height)];
        _positionLabel.textColor = [UIColor grayColor];
        _positionLabel.font = [UIFont systemFontOfSize:12];
        _positionLabel.textAlignment = NSTextAlignmentCenter;
        //_positionLabel.backgroundColor = [UIColor yellowColor];
        [self.contentView addSubview:_positionLabel];
        
        UILabel *line = [[UILabel alloc] initWithFrame:CGRectMake(_positionLabel.right + 10*kWidthBase + 5*kWidthBase, _headImageV.top, 1, _positionLabel.bottom - _headImageV.top)];
        line.backgroundColor = [UIColor grayColor];
        [self.contentView addSubview:line];
        
        _descriptionLabel = [[UILabel alloc] initWithFrame:CGRectMake(line.right + 10*kWidthBase, _headImageV.top, (kScreenWidth - 20*kWidthBase - line.right - 10*kWidthBase), _positionLabel.bottom - _headImageV.top)];
        _descriptionLabel.textColor = [UIColor grayColor];
        _descriptionLabel.font = [UIFont systemFontOfSize:14];
        _descriptionLabel.numberOfLines = 0;
        [self.contentView addSubview:_descriptionLabel];
        
        

        
    }
    
    
    return self;
    
}

- (void)setModel:(MqAuthModel *)model
{
    _model = model;
    
    [_headImageV sd_setImageWithURL:[NSURL URLWithString:model.userPic] placeholderImage:[UIImage imageNamed:@"info-touxiang"]];
    _nameLabel.text = model.name;
    _positionLabel.text = model.position;
    _descriptionLabel.text = model.Description;
    
    
    
}


- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
